package com.dashboard.cloud.provider.controller;

import com.dashboard.cloud.common.dto.UserDTO;
import com.dashboard.cloud.provider.service.RemoteServerService;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * All rights Reserved, Designed By www.super-master.com
 *
 * @ProjectName: spring-cloud-dashboard
 * @Package: com.dashboard.cloud.provider.controller
 * @ClassName: RemoteServerController
 * @Description: [模拟远程服务调用服务接口]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2024/11/15 11:35
 * @Version: V1.0
 * @Copyright: 2024 www.super-master.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@RestController
@RequestMapping("/remote/sever")
public class RemoteServerController {

    @Resource
    private RemoteServerService remoteServerService;

    @GetMapping("/status")
    public String running() {
        return remoteServerService.running();
    }


    // -------------------------------------------------------------
    @GetMapping("/user/{userId}")
    public UserDTO queryUserByPrimary(@PathVariable("userId") Long userId) {
        return remoteServerService.queryUserByPrimary(userId);
    }


}